package com.mulanweb.api.module.controller;

import com.jfinal.plugin.activerecord.Page;
import com.mulanweb.api.module.model.SearchHistory;
import com.mulanweb.api.module.model.Visa;
import com.mulanweb.api.module.model.VisaChild;
import com.mulanweb.db.common.SQLGenerateHelper;
import com.mulanweb.validator.annotation.ValidateFile;
import com.mulanweb.validator.annotation.ValidateForm;

import java.util.List;

/**
 * Created by Administrator on 2016/11/8 0008.
 */
@ValidateFile
public class SearchHistoryController extends BaseController {

    /**
     * 搜索签证信息
     */
    @ValidateForm
    public void getUsereHistory() {
        /*SQLGenerateHelper helper = new SQLGenerateHelper("visa", "create_time desc");
        helper.addIsNullCondition("delete_time");
        helper.addEqualsCondition("status_id","20");//过滤已下架商品
        Page<Visa> page = Visa.dao.paginate(getParaToInt("PageNumber"), getParaToInt("PageSize"), helper.getSqlSelect(), helper.getSqlExceptSelect(), helper.getQueryParas());
        returnPageModelJson(page);*/
        SQLGenerateHelper helper = new SQLGenerateHelper("search_history", "create_time desc");
        Page<SearchHistory> page = SearchHistory.dao.paginate(getParaToInt("PageNumber"), getParaToInt("PageSize"), helper.getSqlSelect(), helper.getSqlExceptSelect(), helper.getQueryParas());
        returnPageModelJson(page);
    }

    @ValidateForm
    private void save() {
        /*int visaId = getParaToInt("visaId");
        Visa visa = Visa.dao.findById(visaId);
        returnSuccessJson(visa);*/
    }

}
